<?php
namespace App\Util;

use PhpAmqpLib\Connection\AMQPStreamConnection;

class RabbitMqTest {



    public static $instance;
    private function __clone(){

    }
    private function __construct()
    {
    }

    public static function getInstance()
    {
        if(self::$instance instanceof self){
           return self::$instance;
        }else{
            return self::$instance = new self();
        }
    }

    public function GetClient()
    {
        $connection = new AMQPStreamConnection(
            config('services.rabbit.host'),
            config('services.rabbit.port'),
            config('services.rabbit.user'),
            config('services.rabbit.pwd'),
        );
        return  $connection;
    }
}
